/*
 *	Copyright 2011 ja4cli
 *
 *	Licensed under the Apache License, Version 2.0 (the "License");
 *	you may not use this file except in compliance with the License.
 *	You may obtain a copy of the License at
 *
 *		http://www.apache.org/licenses/LICENSE-2.0
 *
 *	Unless required by applicable law or agreed to in writing, software
 *	distributed under the License is distributed on an "AS IS" BASIS,
 *	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *	See the License for the specific language governing permissions and
 *	limitations under the License.
 */
package org.skarby.ja4cli.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Representation of a Option argument.<p/>
 * 
 * A {@link Option} argument should be understood as a argument that only has value, but no definition. eg.:
 * <pre>
 * 	java Program myOption
 * </pre>
 * Where <code>myOption</code> is an {@link Option}.
 * 
 * @author askarby
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Option {

	/**
	 * The index of the option.<p/>
	 * 
	 * If this value is omitted or a negative integer the index will be inferred
	 * by it's declared position within the class file.<p/>
	 * 
	 * There's no need to manually do bookkeeping to maintain a continuous order in the numbering.
	 * The following order of indexes:
	 * 
	 * <pre>1, 2, 300, 600, 700, 730, 1000</pre>
	 * 
	 * becomes:
	 * 
	 * <pre>0, 1, 2, 3, 4, 5, 6</pre>
	 * 
	 * @return the index of the option.
	 */
	int index() default -1;
}
